package com.neusoft.elmboot.controller;


import com.neusoft.elmboot.po.Business;
import com.neusoft.elmboot.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RestController
@RequestMapping("/BusinessController")
public class BusinessController {


    @Autowired
    private BusinessService businessService;

    @PostMapping( "/listBusinessByOrderTypeId")
    public List<Business> listBusinessByOrderTypeId(Business business) throws Exception{
        return businessService.listBusinessByOrderTypeId(business.getOrderTypeId());
    }

    @PostMapping("/getBusinessById")
    public Business getBusinessById(Business business) throws Exception{
        return businessService.getBusinessById(business.getBusinessId());
    }
}








    //    @Autowired
//    private BusinessService businessService;
//
//    @PostMapping(value = "/listBusinessByOrderTypeId")
//    public List<Business> listBusinessByOrderTypeId(@RequestBody Business business) throws Exception {
//        return businessService.listBusinessByOrderTypeId(business.getOrderTypeId());
//    }
//
//    @GetMapping("/getBusinessById")
//    public Business getBusinessById(@RequestParam("businessId") Integer businessId) throws Exception {
//        return businessService.getBusinessById(businessId);
//    }




